package com.elai.baseconfig.service.impl;

import java.util.List;
import com.elai.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.elai.baseconfig.mapper.ChannelPushConfigMapper;
import com.elai.baseconfig.domain.ChannelPushConfig;
import com.elai.baseconfig.service.IChannelPushConfigService;

/**
 * 推送参数配置Service业务层处理
 * 
 * @author elai
 * @date 2021-09-03
 */
@Service
public class ChannelPushConfigServiceImpl implements IChannelPushConfigService 
{
    @Autowired
    private ChannelPushConfigMapper channelPushConfigMapper;

    /**
     * 查询推送参数配置
     * 
     * @param id 推送参数配置ID
     * @return 推送参数配置
     */
    @Override
    public ChannelPushConfig selectChannelPushConfigById(Long id)
    {
        return channelPushConfigMapper.selectChannelPushConfigById(id);
    }

    /**
     * 查询推送参数配置列表
     * 
     * @param channelPushConfig 推送参数配置
     * @return 推送参数配置
     */
    @Override
    public List<ChannelPushConfig> selectChannelPushConfigList(ChannelPushConfig channelPushConfig)
    {
        return channelPushConfigMapper.selectChannelPushConfigList(channelPushConfig);
    }

    /**
     * 新增推送参数配置
     * 
     * @param channelPushConfig 推送参数配置
     * @return 结果
     */
    @Override
    public int insertChannelPushConfig(ChannelPushConfig channelPushConfig)
    {
        channelPushConfig.setCreateTime(DateUtils.getNowDate());
        return channelPushConfigMapper.insertChannelPushConfig(channelPushConfig);
    }

    /**
     * 修改推送参数配置
     * 
     * @param channelPushConfig 推送参数配置
     * @return 结果
     */
    @Override
    public int updateChannelPushConfig(ChannelPushConfig channelPushConfig)
    {
        channelPushConfig.setUpdateTime(DateUtils.getNowDate());
        return channelPushConfigMapper.updateChannelPushConfig(channelPushConfig);
    }

    /**
     * 批量删除推送参数配置
     * 
     * @param ids 需要删除的推送参数配置ID
     * @return 结果
     */
    @Override
    public int deleteChannelPushConfigByIds(Long[] ids)
    {
        return channelPushConfigMapper.deleteChannelPushConfigByIds(ids);
    }

    /**
     * 删除推送参数配置信息
     * 
     * @param id 推送参数配置ID
     * @return 结果
     */
    @Override
    public int deleteChannelPushConfigById(Long id)
    {
        return channelPushConfigMapper.deleteChannelPushConfigById(id);
    }
}
